#ifndef _H_C_SERVICE_RESOLVER_HELPER_H_
#define _H_C_SERVICE_RESOLVER_HELPER_H_

#include "SServiceFrontendID.h"
#include "IToServiceFrontendMsg.h"

namespace QWER
{
	QCLASS IRunner;
	QCLASS IServiceBackend;

	QDLL_EXPORT QCLASS CServiceBackendHelper
	{
	public:
		CServiceBackendHelper(PTR(IServiceBackend) poServiceBackend);
		inline PTR(IRunner) GetRunner() { return m_poRunner; }

		void PostMsgToFrontend(const SServiceFrontendID& rsFrontendID, QMOVEABLE(IToServiceFrontendMsg) poMsg);

	private:
		PTR(IServiceBackend) m_poServiceResolver = NULL_PTR;
		IRunner* m_poRunner = NULL_PTR;

	private:
		friend class IRunner;
		template<typename T> friend class CNewBackendMsg;
		void _SetRunner(IRunner* poRunner) { m_poRunner = poRunner; }
	};
}

#endif
